package com.Cheng.service;

import com.Cheng.dao.IncomeMapper;
import com.Cheng.dao.OutcomeMapper;
import com.Cheng.pojo.Income;
import com.Cheng.pojo.Outcome;

import java.util.List;

/**
 * @Author Cheng
 * @Date 2022/4/10 15:54
 * service的impl是把mapper和service进行整合的文件。
 */
public class OutcomeServiceImpl implements OutcomeService{
    //Service调用dao层：组合Dao
    private OutcomeMapper outcomeMapper;

    public void setOutcomeMapper(OutcomeMapper outcomeMapper) {
        this.outcomeMapper = outcomeMapper;
    }

    @Override
    public int addOutcome(Outcome outcome) {
        return outcomeMapper.addOutcome(outcome);
    }

    @Override
    public int deleteOutcomeById(int id) {
        return outcomeMapper.deleteOutcomeById(id);
    }

    @Override
    public int updateOutcome(Outcome outcome) {
        return  outcomeMapper.updateOutcome(outcome);
    }

    @Override
    public Outcome queryOutcomeById(int id) {
        return outcomeMapper.queryOutcomeById(id);
    }

    @Override
    public List<Outcome> queryAllOutcome() {
        return outcomeMapper.queryAllOutcome();
    }
}
